1. Field of the Invention
The present invention relates to a technique of compressing data size of image data input into an image processing apparatus and storing compressed image data for reduction of memory resource and high speed processing.
2. Description of the Related Art
In an image processing apparatus, it is necessary to handle high resolution image data for improvement in image quality and image processing function. For this purpose, an image compression method to efficiently hold high resolution image is required.
As a conventional image compression method, a method of dividing an image into predetermined sized regions and selecting compression processing in region units is known (e.g. see Japanese Patent Laid-Open No. 2008-42687). According to this method, a high compression ratio can be achieved by encoding an image resolution-converted with a resolution converter in compression processing.
Further, a method of pseudo high-resolution conversion processing to restore an original image is known (e.g. see Japanese Patent Laid-Open No. 2008-238590). According to this method, it is possible to restore a high resolution image while reduce the data size by resolution conversion by adding attribute data (pixel pattern or the like) corresponding to each pixel to a converted low-resolution image.
In an image processing apparatus, the memory resource to store image data is limited, and especially when high resolution image data is handled, since the size of the image data is large, it is necessary to save the memory resource. Accordingly, it is necessary to control the size of image data after conversion to a predetermined or smaller data size.
In this pseudo high-resolution conversion processing, regarding an image having a pattern where the pixel values of peripheral pixels are complicated, the amount of attribute data tends to be large. In some cases, the size of resolution-converted image data is larger than that of original image data. In such case, it is possible to perform re-conversion processing by performing color-reduction processing on the original image to equalize pixel values of peripheral pixels thus reduce the attribute data.
However, in the conventional re-conversion processing, since the color-reduction processing is sequentially performed by each rectangular region, the size of image data is determined after the conversion. Accordingly, in only one color-reduction processing, an optimum size of the image data cannot be obtained, and problems of reduction of processing speed and degradation of image quality as follows occur.
First, when the degree of color-reduction processing (hereinbelow, referred to as a “color-reduction processing level”) is low, the size of the image data cannot be sufficiently reduced, and it is necessary to change the color-reduction processing level and perform the re-conversion processing again.
Second, when the color-reduction processing level is high, the size of compressed image data is unnecessarily reduced and image quality is degraded. As a result, it is necessary to repeat the color-reduction processing and pseudo high-resolution conversion processing to obtain an optimum image data size. This reduces the entire processing speed.